package cn.wzy.controller;



import cn.wzy.pojo.Logininfo;
import cn.wzy.results.ResponseResult;
import cn.wzy.service.LogininfoService;
import cn.wzy.vo.GoPageVo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Logininfo)表控制层
 *
 * @author makejava
 * @since 2023-02-06 16:25:37
 */
@RestController
@RequestMapping("logininfo")
public class LogininfoController{
    /**
     * 服务对象
     */
    @Resource
    private LogininfoService logininfoService;
    
    /*
    * 查询分页
    * */
    @PostMapping("/page")
    public ResponseResult getLogininfoPage(@RequestBody GoPageVo goPageVo){
        return logininfoService.getLogininfoPage(goPageVo);
    }

    /*
    * 查询
    * */
    @GetMapping("/{id}")
    public ResponseResult getLogininfo(@PathVariable("id") Long id){
        return logininfoService.getLogininfo(id);
    }

    /*
    * 新增和修改
    * */
    @PostMapping
    public ResponseResult saveLogininfo(@RequestBody Logininfo logininfo){
        return logininfoService.saveLogininfo(logininfo);
    }

    /*
    * 删除
    * */
    @DeleteMapping("/{id}")
    public ResponseResult deleteLogininfo(@PathVariable("id") Long id){
        return logininfoService.deleteLogininfo(id);
    }


    /*
    * 批量删除
    * */
    @PatchMapping
    public ResponseResult deleteLogininfoList(@RequestBody List<Long> ids){
        return logininfoService.deleteLogininfoList(ids);
    }



}

